export const getWeather = (code) => {
    //加载天气查询插件
    return new Promise((resolve, reject) => {
        AMap.plugin("AMap.Weather", function () {
            //创建天气查询实例
            var weather = new AMap.Weather()
            //执行实时天气信息查询
            weather.getLive(`${code}`, function (err, data) {
                let weatherCity = data
                resolve (weatherCity)
            })   
        })
    })
}